
#ifndef BC_DEBUGGER_H
#define BC_DEBUGGER_H

#include "dependancies.h"



#ifdef BC_DEBUG_VERSION
	#define BC_INIT_DEBUGGER					BCDebugger::init();
	#define BC_DEBUG_ERROR(text)				BCDebugger::error(text);
	#define BC_CHECK_ERROR(condition , text)	BCDebugger::checkError(condition , text);
	#define BC_DEBUG_WARNING(text)				BCDebugger::warning(text);
	#define BC_LOG_TEXT(value)					BCDebugger::info_s(value);
	#define BC_LOG_VALUE(value)					BCDebugger::info_f(value);
	#define BC_DESTROY_DEBUGGER					BCDebugger::destroy();
	#define BC_CLEAR_DEBUGGER					BCDebugger::clearList();
#else
	#define BC_INIT_DEBUGGER
	#define BC_DEBUG_ERROR(text)
	#define BC_CHECK_ERROR(condition , text)
	#define BC_DEBUG_WARNING(text)
	#define BC_LOG_TEXT(value)
	#define BC_LOG_VALUE(value)
	#define BC_DESTROY_DEBUGGER
	#define BC_CLEAR_DEBUGGER
#endif



class BCDebugger
{
	public:
	
		static void error(const std::string& text);
		static void checkError(bool condition , const std::string& text);
		static void checkError(bool condition , const std::string& trueText , const std::string& falseText);

		static void warning(const std::string& text);

		static void info_s(const std::string& text);

		static void info_f(float value);
		

		static void clearList();

		// automatically clears the window if the window reaches the number of messages
		static void clearAfter(int numMessages);

		// inits the debugger.If not called , no debug data will be displayed...
		static void init();

		// destroys the debug window
		static void destroy();

	private:

		static void insertItem(const std::string& level , const std::string& text);

		static HWND debugWindow , listView;

		static int maxMessages;

		static LRESULT CALLBACK DebugWindowCallback(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);

};



#endif




